<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>视频对象操作</title>
</head>

<body>
    <video id="myVideo" src="fun.ogv"></video><br>
    <input type="button" value="播放/暂停">

    <!-- js实现视频对象的操作 -->
    <script>
        var myVideo = document.querySelector("#myVideo");
        var oBtn = document.querySelector("input")
        oBtn.onclick = function() {
            if (myVideo.paused) {
                myVideo.play();
            } else {
                myVideo.pause();
            }
        }
    </script>
</body>

</html>